3.1.14 \(\int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx\) [14]

3.1.14.1 Optimal result
3.1.14.2 Mathematica [A] (verified)
3.1.14.3 Rubi [A] (verified)
3.1.14.4 Maple [A] (verified)
3.1.14.5 Fricas [A] (verification not implemented)
3.1.14.6 Sympy [F]
3.1.14.7 Maxima [B] (verification not implemented)
3.1.14.8 Giac [A] (verification not implemented)
3.1.14.9 Mupad [B] (verification not implemented)

3.1.14.1 Optimal result

Integrand size = 26, antiderivative size = 97 \[ \int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=a^3 c^2 x+\frac {3 a^3 c^2 \text {arctanh}(\sin (e+f x))}{8 f}-\frac {c^2 \left (8 a^3+3 a^3 \sec (e+f x)\right ) \tan (e+f x)}{8 f}+\frac {c^2 \left (4 a^3+3 a^3 \sec (e+f x)\right ) \tan ^3(e+f x)}{12 f} \]

output
a^3*c^2*x+3/8*a^3*c^2*arctanh(sin(f*x+e))/f-1/8*c^2*(8*a^3+3*a^3*sec(f*x+e 
))*tan(f*x+e)/f+1/12*c^2*(4*a^3+3*a^3*sec(f*x+e))*tan(f*x+e)^3/f
 
3.1.14.2 Mathematica [A] (verified)

Time = 0.46 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.26 \[ \int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {a^3 c^2 \sec ^4(e+f x) \left (72 e+72 f x+72 \text {arctanh}(\sin (e+f x)) \cos ^4(e+f x)+96 (e+f x) \cos (2 (e+f x))+24 e \cos (4 (e+f x))+24 f x \cos (4 (e+f x))+18 \sin (e+f x)-32 \sin (2 (e+f x))-30 \sin (3 (e+f x))-32 \sin (4 (e+f x))\right )}{192 f} \]

input
Integrate[(a + a*Sec[e + f*x])^3*(c - c*Sec[e + f*x])^2,x]
 
output
(a^3*c^2*Sec[e + f*x]^4*(72*e + 72*f*x + 72*ArcTanh[Sin[e + f*x]]*Cos[e + 
f*x]^4 + 96*(e + f*x)*Cos[2*(e + f*x)] + 24*e*Cos[4*(e + f*x)] + 24*f*x*Co 
s[4*(e + f*x)] + 18*Sin[e + f*x] - 32*Sin[2*(e + f*x)] - 30*Sin[3*(e + f*x 
)] - 32*Sin[4*(e + f*x)]))/(192*f)
 
3.1.14.3 Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.92, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.269, Rules used = {3042, 4392, 3042, 4369, 3042, 4369, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (a \sec (e+f x)+a)^3 (c-c \sec (e+f x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^3 \left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right )^2dx\)

\(\Big \downarrow \) 4392

\(\displaystyle a^2 c^2 \int (\sec (e+f x) a+a) \tan ^4(e+f x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle a^2 c^2 \int \cot \left (e+f x+\frac {\pi }{2}\right )^4 \left (\csc \left (e+f x+\frac {\pi }{2}\right ) a+a\right )dx\)

\(\Big \downarrow \) 4369

\(\displaystyle a^2 c^2 \left (\frac {\tan ^3(e+f x) (3 a \sec (e+f x)+4 a)}{12 f}-\frac {1}{4} \int (3 \sec (e+f x) a+4 a) \tan ^2(e+f x)dx\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle a^2 c^2 \left (\frac {\tan ^3(e+f x) (3 a \sec (e+f x)+4 a)}{12 f}-\frac {1}{4} \int \cot \left (e+f x+\frac {\pi }{2}\right )^2 \left (3 \csc \left (e+f x+\frac {\pi }{2}\right ) a+4 a\right )dx\right )\)

\(\Big \downarrow \) 4369

\(\displaystyle a^2 c^2 \left (\frac {1}{4} \left (\frac {1}{2} \int (3 \sec (e+f x) a+8 a)dx-\frac {\tan (e+f x) (3 a \sec (e+f x)+8 a)}{2 f}\right )+\frac {\tan ^3(e+f x) (3 a \sec (e+f x)+4 a)}{12 f}\right )\)

\(\Big \downarrow \) 2009

\(\displaystyle a^2 c^2 \left (\frac {1}{4} \left (\frac {1}{2} \left (\frac {3 a \text {arctanh}(\sin (e+f x))}{f}+8 a x\right )-\frac {\tan (e+f x) (3 a \sec (e+f x)+8 a)}{2 f}\right )+\frac {\tan ^3(e+f x) (3 a \sec (e+f x)+4 a)}{12 f}\right )\)

input
Int[(a + a*Sec[e + f*x])^3*(c - c*Sec[e + f*x])^2,x]
 
output
a^2*c^2*(((4*a + 3*a*Sec[e + f*x])*Tan[e + f*x]^3)/(12*f) + ((8*a*x + (3*a 
*ArcTanh[Sin[e + f*x]])/f)/2 - ((8*a + 3*a*Sec[e + f*x])*Tan[e + f*x])/(2* 
f))/4)
 

3.1.14.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4369
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( 
a_)), x_Symbol] :> Simp[(-e)*(e*Cot[c + d*x])^(m - 1)*((a*m + b*(m - 1)*Csc 
[c + d*x])/(d*m*(m - 1))), x] - Simp[e^2/m   Int[(e*Cot[c + d*x])^(m - 2)*( 
a*m + b*(m - 1)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && GtQ[m 
, 1]
 

rule 4392
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*( 
d_.) + (c_))^(n_.), x_Symbol] :> Simp[((-a)*c)^m   Int[Cot[e + f*x]^(2*m)*( 
c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && E 
qQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !( 
IntegerQ[n] && GtQ[m - n, 0])
 
3.1.14.4 Maple [A] (verified)

Time = 2.74 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.37

method result size
parts \(a^{3} c^{2} x -\frac {c^{2} a^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}+\frac {c^{2} a^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )}{f}-\frac {2 c^{2} a^{3} \tan \left (f x +e \right )}{f}-\frac {c^{2} a^{3} \tan \left (f x +e \right ) \sec \left (f x +e \right )}{f}\) \(133\)
risch \(a^{3} c^{2} x +\frac {i c^{2} a^{3} \left (15 \,{\mathrm e}^{7 i \left (f x +e \right )}-48 \,{\mathrm e}^{6 i \left (f x +e \right )}-9 \,{\mathrm e}^{5 i \left (f x +e \right )}-96 \,{\mathrm e}^{4 i \left (f x +e \right )}+9 \,{\mathrm e}^{3 i \left (f x +e \right )}-80 \,{\mathrm e}^{2 i \left (f x +e \right )}-15 \,{\mathrm e}^{i \left (f x +e \right )}-32\right )}{12 f \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right )^{4}}+\frac {3 c^{2} a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{8 f}-\frac {3 c^{2} a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{8 f}\) \(162\)
derivativedivides \(\frac {c^{2} a^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )-c^{2} a^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-2 c^{2} a^{3} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-2 c^{2} a^{3} \tan \left (f x +e \right )+c^{2} a^{3} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+c^{2} a^{3} \left (f x +e \right )}{f}\) \(169\)
default \(\frac {c^{2} a^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )-c^{2} a^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-2 c^{2} a^{3} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-2 c^{2} a^{3} \tan \left (f x +e \right )+c^{2} a^{3} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+c^{2} a^{3} \left (f x +e \right )}{f}\) \(169\)
parallelrisch \(\frac {a^{3} c^{2} \left (-9 \left (3+\cos \left (4 f x +4 e \right )+4 \cos \left (2 f x +2 e \right )\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )-9 \left (-\cos \left (4 f x +4 e \right )-4 \cos \left (2 f x +2 e \right )-3\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )+96 f x \cos \left (2 f x +2 e \right )+24 f x \cos \left (4 f x +4 e \right )+72 f x -30 \sin \left (3 f x +3 e \right )-32 \sin \left (4 f x +4 e \right )+18 \sin \left (f x +e \right )-32 \sin \left (2 f x +2 e \right )\right )}{24 f \left (3+\cos \left (4 f x +4 e \right )+4 \cos \left (2 f x +2 e \right )\right )}\) \(182\)
norman \(\frac {a^{3} c^{2} x +a^{3} c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}-4 a^{3} c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+6 a^{3} c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}-4 a^{3} c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}-\frac {11 c^{2} a^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {137 c^{2} a^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{12 f}-\frac {71 c^{2} a^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{12 f}+\frac {5 c^{2} a^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{4 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{4}}-\frac {3 c^{2} a^{3} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{8 f}+\frac {3 c^{2} a^{3} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{8 f}\) \(238\)

input
int((a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x,method=_RETURNVERBOSE)
 
output
a^3*c^2*x-c^2*a^3/f*(-2/3-1/3*sec(f*x+e)^2)*tan(f*x+e)+c^2*a^3/f*(-(-1/4*s 
ec(f*x+e)^3-3/8*sec(f*x+e))*tan(f*x+e)+3/8*ln(sec(f*x+e)+tan(f*x+e)))-2*c^ 
2*a^3/f*tan(f*x+e)-c^2*a^3/f*tan(f*x+e)*sec(f*x+e)
 
3.1.14.5 Fricas [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.52 \[ \int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {48 \, a^{3} c^{2} f x \cos \left (f x + e\right )^{4} + 9 \, a^{3} c^{2} \cos \left (f x + e\right )^{4} \log \left (\sin \left (f x + e\right ) + 1\right ) - 9 \, a^{3} c^{2} \cos \left (f x + e\right )^{4} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (32 \, a^{3} c^{2} \cos \left (f x + e\right )^{3} + 15 \, a^{3} c^{2} \cos \left (f x + e\right )^{2} - 8 \, a^{3} c^{2} \cos \left (f x + e\right ) - 6 \, a^{3} c^{2}\right )} \sin \left (f x + e\right )}{48 \, f \cos \left (f x + e\right )^{4}} \]

input
integrate((a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x, algorithm="fricas")
 
output
1/48*(48*a^3*c^2*f*x*cos(f*x + e)^4 + 9*a^3*c^2*cos(f*x + e)^4*log(sin(f*x 
 + e) + 1) - 9*a^3*c^2*cos(f*x + e)^4*log(-sin(f*x + e) + 1) - 2*(32*a^3*c 
^2*cos(f*x + e)^3 + 15*a^3*c^2*cos(f*x + e)^2 - 8*a^3*c^2*cos(f*x + e) - 6 
*a^3*c^2)*sin(f*x + e))/(f*cos(f*x + e)^4)
 
3.1.14.6 Sympy [F]

\[ \int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=a^{3} c^{2} \left (\int 1\, dx + \int \sec {\left (e + f x \right )}\, dx + \int \left (- 2 \sec ^{2}{\left (e + f x \right )}\right )\, dx + \int \left (- 2 \sec ^{3}{\left (e + f x \right )}\right )\, dx + \int \sec ^{4}{\left (e + f x \right )}\, dx + \int \sec ^{5}{\left (e + f x \right )}\, dx\right ) \]

input
integrate((a+a*sec(f*x+e))**3*(c-c*sec(f*x+e))**2,x)
 
output
a**3*c**2*(Integral(1, x) + Integral(sec(e + f*x), x) + Integral(-2*sec(e 
+ f*x)**2, x) + Integral(-2*sec(e + f*x)**3, x) + Integral(sec(e + f*x)**4 
, x) + Integral(sec(e + f*x)**5, x))
 
3.1.14.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 203 vs. \(2 (91) = 182\).

Time = 0.20 (sec) , antiderivative size = 203, normalized size of antiderivative = 2.09 \[ \int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {16 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} c^{2} + 48 \, {\left (f x + e\right )} a^{3} c^{2} - 3 \, a^{3} c^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 24 \, a^{3} c^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 48 \, a^{3} c^{2} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) - 96 \, a^{3} c^{2} \tan \left (f x + e\right )}{48 \, f} \]

input
integrate((a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x, algorithm="maxima")
 
output
1/48*(16*(tan(f*x + e)^3 + 3*tan(f*x + e))*a^3*c^2 + 48*(f*x + e)*a^3*c^2 
- 3*a^3*c^2*(2*(3*sin(f*x + e)^3 - 5*sin(f*x + e))/(sin(f*x + e)^4 - 2*sin 
(f*x + e)^2 + 1) - 3*log(sin(f*x + e) + 1) + 3*log(sin(f*x + e) - 1)) + 24 
*a^3*c^2*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + lo 
g(sin(f*x + e) - 1)) + 48*a^3*c^2*log(sec(f*x + e) + tan(f*x + e)) - 96*a^ 
3*c^2*tan(f*x + e))/f
 
3.1.14.8 Giac [A] (verification not implemented)

Time = 0.35 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.58 \[ \int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {24 \, {\left (f x + e\right )} a^{3} c^{2} + 9 \, a^{3} c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right ) - 9 \, a^{3} c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right ) + \frac {2 \, {\left (15 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 71 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 137 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 33 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{4}}}{24 \, f} \]

input
integrate((a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x, algorithm="giac")
 
output
1/24*(24*(f*x + e)*a^3*c^2 + 9*a^3*c^2*log(abs(tan(1/2*f*x + 1/2*e) + 1)) 
- 9*a^3*c^2*log(abs(tan(1/2*f*x + 1/2*e) - 1)) + 2*(15*a^3*c^2*tan(1/2*f*x 
 + 1/2*e)^7 - 71*a^3*c^2*tan(1/2*f*x + 1/2*e)^5 + 137*a^3*c^2*tan(1/2*f*x 
+ 1/2*e)^3 - 33*a^3*c^2*tan(1/2*f*x + 1/2*e))/(tan(1/2*f*x + 1/2*e)^2 - 1) 
^4)/f
 
3.1.14.9 Mupad [B] (verification not implemented)

Time = 15.66 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.68 \[ \int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {\frac {5\,a^3\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7}{4}-\frac {71\,a^3\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5}{12}+\frac {137\,a^3\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{12}-\frac {11\,a^3\,c^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{4}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}+a^3\,c^2\,x+\frac {3\,a^3\,c^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{4\,f} \]

input
int((a + a/cos(e + f*x))^3*(c - c/cos(e + f*x))^2,x)
 
output
((137*a^3*c^2*tan(e/2 + (f*x)/2)^3)/12 - (71*a^3*c^2*tan(e/2 + (f*x)/2)^5) 
/12 + (5*a^3*c^2*tan(e/2 + (f*x)/2)^7)/4 - (11*a^3*c^2*tan(e/2 + (f*x)/2)) 
/4)/(f*(6*tan(e/2 + (f*x)/2)^4 - 4*tan(e/2 + (f*x)/2)^2 - 4*tan(e/2 + (f*x 
)/2)^6 + tan(e/2 + (f*x)/2)^8 + 1)) + a^3*c^2*x + (3*a^3*c^2*atanh(tan(e/2 
 + (f*x)/2)))/(4*f)